package com.leetone.testng;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 * @ProjectName: testng
 * @Package: com.leetone.testng
 * @ClassName: MyPage
 * @Description: 【百度页面，对象定位和操作，继承BasePage】
 * @Author: 谭磊
 * @Email: leetone123@163.com
 * @CreateDate: 2018/11/4 13:51
 * @UpdateUser: 更新者：
 * @UpdateDate: 2018/11/4 13:51
 * @UpdateRemark: 更新说明：接下来就是实现页面对象获取了，下面以百度页面为示例
 * @Version: 1.0
 */
public class BaiDuPage extends BasePage {
    public BaiDuPage(WebDriver driver){
        super(driver);
    }

    //关键词输入框
    @FindBy(id="kw")
    private WebElement kw_Element;

    @FindBy(id="su")
    private WebElement su_Element;

    /**
     * 输入关键词
     */
    public void kwSendKeys(String s){
        this.sendkeys(kw_Element,s);
    }

    /**
     * 点击搜索按钮
     */
    public void suClick(){
        this.click(su_Element);
    }
}